package com.hp.gxw.controller;


import com.baomidou.mybatisplus.core.toolkit.StringUtils;
import com.hp.gxw.constant.R;
import com.hp.gxw.service.ICostWorkOrderStatusService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;
import org.springframework.web.bind.annotation.RestController;

/**
 * <p>
 *  前端控制器
 * </p>
 *
 * @author huangping
 * @since 2024-02-21
 */
@RestController
@RequestMapping("/manage/work_order_status")
public class CostWorkOrderStatusController {

    @Autowired
    private ICostWorkOrderStatusService iCostWorkOrderStatusService;

    @RequestMapping("/pull")
    @ResponseBody
    public R pull(@RequestBody String month){
        if(StringUtils.isEmpty(month)){
            return R.error("参数异常");
        }
        try {
            iCostWorkOrderStatusService.handlePull(month);
        }catch (Exception e){
            e.printStackTrace();
            return R.error("系统异常");
        }
        return R.ok();
    }
}

